package com.example.sharding.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.sharding.domain.entity.Department;
import com.example.sharding.domain.entity.User;
import com.example.sharding.domain.mapper.UserMapper;
import com.example.sharding.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author wf
 * @date 2019/11/14
 */
@Service
@Transactional(rollbackFor = {Exception.class})
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<Department> getDeptByUserId(String userId) {
       return userMapper.getDeptByUserId( userId);
    }
}
